# # 统计数量
# class aaa:
#     # 类下面定义的变量类变量
#     count = 0
#
#     def __init__(self, name):
#         self.name = name
#         print(f'打蜡是{self.name}')
#         aaa.count += 1  # 在方法中使用变量， 类名.变量名
#
#
# t1 = aaa(name='aaaaa')  # 实例化对象
# t2 = aaa(name='bbbbb')  # 实例化对象
# # 类变量  使用   类名.变量名
# print(aaa.count)


# 封装、继承、多态
# 不同的 子类 调用相同的父类，产生不同的结果
# class dog():
#
#     def __init__(self,name):
#         self.name = name
#
#     def game(self):
#         print('普通的狗，只能简单的玩')
#
# class GodDog(dog):
#     def game(self):
#         print('神狗要去天上玩...')
#
# class person():
#     def __init__(self,name):
#         self.name = name
#
#     def game_with_dog(self,which_dog):
#         print(f'{self.name}和{which_dog.name}一起玩')
#         which_dog.game() #
#
# wangcai = dog(name='旺财')
# xtq = GodDog(name='哮天犬')
# xiaoming = person('小明')
# xiaoming.game_with_dog(which_dog=xtq)




class woman():

    def __init__(self,name):
        self.name = name
        # 私有属性、变量
        # self.__变量名
        self.__age = 18

    def __myage(self):
        print(f'我的年龄是{self.__age}')


t1 = woman(name='张三')